import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useMenuStore = defineStore('menu', () => {
  const menuItems = ref([
    {
      id: 'all',
      text: '全部',
      link: '#',
      icon: 'fas fa-th-list'
    },
    {
      id: 'subscribe',
      text: '订阅',
      link: '#',
      icon: 'fas fa-rss',
    },
    {
      id: 'following',
      text: '关注',
      link: '#',
      icon: 'fas fa-heart'
    },
    {
      id: 'comments',
      text: '我评',
      link: '#',
      icon: 'fas fa-comment'
    },
    {
      id: 'share',
      text: '转发',
      link: '#',
      icon: 'fas fa-share'
    }
  ])

  // 当前激活的菜单项 ID
  const activeItemId = ref('all')

  // 设置激活的菜单项
  const setActiveItem = (id) => {
    console.log('Setting active item:', id)
    activeItemId.value = id
  }

  return { 
    menuItems,
    activeItemId,
    setActiveItem
  }
}) 